include ../common.mk

CPPFLAGS += -I$(MPI_INCLUDE)

CU_SRCS=runtime.cu mpi.cu handler.cu pinned_mem_pool.cu
C_SRCS=
CXX_SRCS=
OBJS=$(CU_SRCS:%.cu=%.o) $(C_SRCS:%.c=%.o) $(CXX_SRCS:%.cpp=%.o)

all: libcuos.a

%.a: $(OBJS)
	$(VERBOSE)$(AR) $(ARFLAGS) $@ $^

clean:
	rm -f libcuos.a $(OBJS) *.{hash,ptx} *.fatbin.* *.o .depend

.depend: $(SRCS)
	$(VERBOSE)$(NVCC) $(NVCCFLAGS) $(SMVERSIONFLAGS) $(CPPFLAGS) -M $(CU_SRCS) $(CXX_SRCS) > .depend 2>/dev/null

#ifeq (.depend, $(wildcard .depend))
-include .depend
#endif
